import flask
from flask import request

app = flask.Flask(__name__)

# 请替换为你的抖音云认证信息
API_KEY = 'awtoc0xtjvmmnm68'
API_SECRET = 'f1fe9549008c1093ca8df306cf311ed2'

@app.route('/api/endgame', methods=['POST'])
def douyin_callback():
    # 验证请求
    # 这里需要根据抖音云的认证规范实现具体的验证逻辑
    # 示例：简单打印请求数据
    data = request.get_json()
    print('Received callback data:', data)

    # 返回成功响应
    return {'status': 'success'}, 200

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8000)